ASGetSourceStyles
You can use theASGetSourceStyles
function to get the script format styles currently used by the AppleScript component to display scripts.
FUNCTION ASGetSourceStyles (scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
scriptingComponent
- A component instance created by a prior call to the Component Manager function
OpenDefaultComponent
orOpenComponent
(see page 10-4).resultingSourceStyles
- A handle to a style element array defined by the TextEdit data type
TEStyleTable
that defines the styles used for different kinds of AppleScript terms.DESCRIPTION
TheASGetSourceStyles
function returns a style element array that defines the nine styles used for AppleScript terms.You can use these index constants to identify individual styles returned in the
resultingSourceStyles
parameter:
CONST kASSourceStyleUncompiledText = 0; kASSourceStyleNormalText = 1; kASSourceStyleLanguageKeyword = 2; kASSourceStyleApplicationKeyword = 3; kASSourceStyleComment = 4; kASSourceStyleLiteral = 5; kASSourceStyleUserSymbol = 6; kASSourceStyleObjectSpecifier = 7; kASNumberOfSourceStyles = 8;Other AppleScript dialects may define additional styles. When you have finished using the style element array, you must dispose of it.RESULT CODES
noErr 0 No error errOSASystemError -1750 General scripting system error badComponentInstance $80008001 Invalid component instance SEE ALSO
For information about theTEStyleTable
array, see Inside Macintosh: Text.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help